<template >
  <div>
<!--    <BasicDrawer v-bind="$attrs" @register="registerDrawer" :showFooter="false" title="提交/查看排产计划" width="100%">-->

<!--    </BasicDrawer>-->

    <!--    表格区-->
    <div style="background: white;overflow-y: auto;" :style="{height: (contentHeight*0.99)+'px'}">

      <!--    搜索区-->

      <Anchor  :bounds="1">
        <div class="my_form">
          <vxe-form
            ref="formRef"
            :data="formData"
            size="mini"
            @submit="submitEvent"
            @reset="resetEvent">

            <vxe-form-item title="日期区间" field="date_rang" span="7" :item-render="{}">
              <template #default="params">
                <RangePicker v-model:value="formData.date_rang" size="mini" :disabled="dis_click_jiaban" value-format="YYYY-MM-DD" style="width: 100%"/>
              </template>
            </vxe-form-item>
            <vxe-form-item title="切线分钟数" field="qieNum" span="5"  :item-render="{defaultValue:formData.qieNum}">
              <template #default="params">
                <InputNumber v-model:value="formData.qieNum" size="mini" :disabled="dis_click_jiaban"/>
              </template>
            </vxe-form-item>

            <vxe-form-item  span="7" :item-render="{}">
              <template #default>
                <vxe-button size="mini"  status="success" content="保存" :loading="saveLoading" @click="subFn" :disabled="!dis_click_jiaban" v-if="!mainId&&(userName == '李金虎' ||userName == 'manage')"></vxe-button>

                <!--            type="reset"-->
                <vxe-button size="mini" content="重置" :loading="loading" @click="resetEvent" v-if="!mainId"></vxe-button>
<!--                <vxe-button  content="测试" :loading="loading" @click="testFn" ></vxe-button>-->
<!--                <vxe-button  content="打印" :loading="loading" @click="testFn2" ></vxe-button>-->
                <vxe-button size="mini" content="撤回" :loading="loading" @click="recallFn" v-if="!mainId" :disabled="operator_arr.length==0"></vxe-button>

                <vxe-button size="mini" type="submit" status="primary" content="生成" :loading="loading" :disabled="dis_click_jiaban"></vxe-button>

                <vxe-button size="mini"   status="primary"  content="返回"  @click="backFn" v-if="mainId"></vxe-button>
              </template>
            </vxe-form-item>
            <vxe-form-item title="显示目标产能表格" field="show" span="3" >
              <template #default="params">
                <vxe-switch size="mini" v-model="formData.show" ></vxe-switch>
              </template>
            </vxe-form-item>
          </vxe-form>
        </div>

      </Anchor>

      <div style="margin-left: 10px;padding-top: 42px;font-size: 12px">
        <div v-if="mainId" >
          现处于查看模式mainId:{{mainId}}

          <!--        <vxe-button size="mini" style="margin-left: 15px"  status="error" content="删除该排产记录" :loading="saveLoading" @click="applyViewShow=true" v-if="mainId"></vxe-button>-->
        </div>
      </div>


      <div v-for='(item,index) in planDateList' v-if="planDateList.length>0">




        <Divider size="mini" style="margin: unset;">{{item.date}}</Divider>



        <div  class="table_group" :style="getGroupStyle(item)">

          <div class="my-table" v-if="formData.show">

            <vxe-grid  v-bind="gridOptions" :data="item.left_arr1"    >
              <template #top>
                <div style="height: 46px"></div>
              </template>
              <template #footer_100="{row,rowIndex}">
                {{item.footData['100']}}
              </template>
              <template #footer_200_500="{row,rowIndex}">
                {{item.footData['200_500']}}
              </template>
              <template #footer_step="{row,rowIndex}">
                {{item.footData.step}}
              </template>
              <template #footer_K950="{row,rowIndex}">
                {{item.footData.K950}}
              </template>
            </vxe-grid>

          </div>
          <div class="my-table line-table">
            <vxe-grid  v-bind="gridOptions1" :data="item.arr1" >
              <!--                <template #top>-->
              <!--                  -->
              <!--                </template>-->
              <template #toolbar_buttons>
                <div style="line-height: 31px;margin-left: 10px;display: flex;">
                  <div style="display: flex;">
                    <div>产线1</div>
                    <vxe-button style="margin-left: 5px" content="添加" size="mini" status="primary" v-if="item.iz_add1&&!item.iz_xiu_xi&&!mainId" @click="clickAddFn(index,'arr1')"></vxe-button>
                  </div>

                  <div  class="table_top">
                    <div v-if="!item.iz_xiu_xi">
                      <span>是否加班</span> <vxe-switch size="small" v-model="item.iz_jia_ban" @change="e=>switchJiaBan(e,item)" :disabled="item.no_select_jiaban||!!mainId"></vxe-switch>
                    </div>
                    <div v-if="item.sunday">
                      <span style="margin-left: 20px;color: orangered">该日期为周日</span>
<!--                      <vxe-switch size="small" v-model="item.sun_do" @change="e=>switchSunday(e,item,index)" :disabled="item.no_select_jiaban||!!mainId"></vxe-switch>-->

                    </div>
                    <div >
                      <span style="margin-left: 20px">是否休息</span> <vxe-switch size="small" v-model="item.iz_xiu_xi"  :disabled="!!mainId"></vxe-switch>
                    </div>
                    <div v-if="item.arr1_shengyu_num" style="margin-left: 20px">
                      <vxe-text :content="'1线超出'+item.arr1_shengyu_num+'未安排'" status="error"></vxe-text>
                    </div>
                    <div v-if="item.arr2_shengyu_num" style="margin-left: 20px">
                      <vxe-text :content="'2线超出'+item.arr2_shengyu_num+'未安排'" status="error"></vxe-text>
                    </div>
                  </div>
                </div>
              </template>
              <template #model_default="{row,rowIndex}">
                <div style="white-space: normal;">{{row.model}}<span v-if="row.model2">/{{row.model2}}</span></div>
              </template>
              <template #num_default="{row,rowIndex}">
                <div style="white-space: normal;">{{row.num}}<span v-if="row.num2">/{{row.num2}}</span></div>
              </template>
              <template #tagText_slot="{row,rowIndex}">
                <div style="white-space: normal;">{{row.tagText}}<span v-if="row.tagText2">/{{row.tagText2}}</span></div>
              </template>
              <template #guige_default="{row,rowIndex}">
                <div style="white-space: normal;">{{row.guige}}<span v-if="row.guige2">/{{row.guige2}}</span></div>
              </template>

              <template #orderNo_slot="{row,rowIndex}">
                <div style="white-space: normal;">{{row.biaoShiHao}}<span v-if="row.biaoShiHao2">/{{row.biaoShiHao2}}</span></div>

              </template>
              <template #footer_num="{row,rowIndex}">
                {{item.footData.arr1_total}}
              </template>
              <template #action="{ row ,rowIndex}">
                <TableAction outside :actions="getActions(row,index,rowIndex,'arr1')" />
              </template>

            </vxe-grid>
          </div>
          <div class="my-table line-table">
            <vxe-grid  v-bind="gridOptions2" :data="item.arr2"  >
              <!--                <template #top>-->
              <!--                  -->
              <!--                </template>-->
              <template #toolbar_buttons>
                <div style="line-height: 31px;margin-left: 10px;display: flex;">
                  <div>产线2</div>
                  <vxe-button style="margin-left: 5px" content="添加" size="mini" status="primary" v-if="item.iz_add2&&!item.iz_xiu_xi&&!mainId" @click="clickAddFn(index,'arr2')"></vxe-button>
                </div>
              </template>
              <template #model_default="{row,rowIndex}">
                <div style="white-space: normal;">{{row.model}}<span v-if="row.model2">/{{row.model2}}</span></div>
              </template>
              <template #num_default="{row,rowIndex}">
                <div style="white-space: normal;">{{row.num}}<span v-if="row.num2">/{{row.num2}}</span></div>
              </template>
              <template #guige_default="{row,rowIndex}">
                <div style="white-space: normal;">{{row.guige}}<span v-if="row.guige2">/{{row.guige2}}</span></div>
              </template>

              <template #tagText_slot="{row,rowIndex}">
                <div style="white-space: normal;">{{row.tagText}}<span v-if="row.tagText2">/{{row.tagText2}}</span></div>
              </template>
              <template #orderNo_slot="{row,rowIndex}">
                <div style="white-space: normal;">{{row.biaoShiHao}}<span v-if="row.biaoShiHao2">/{{row.biaoShiHao2}}</span></div>
              </template>
              <template #action="{ row,rowIndex }">
                <TableAction outside :actions="getActions(row,index,rowIndex,'arr2')" />
              </template>
              <template #footer_num="{row,rowIndex}">
                {{item.footData.arr2_total}}
              </template>
            </vxe-grid>
          </div>

        </div>


      </div>

      <SelectOrderIndex ref="selectOrderRef"  @onSubmitFn="addSuccessFn2"       :selectOrderNo="selectOrderNo" :isAdd="true"
      ></SelectOrderIndex>
      <SelectOrderIndex ref="qieXianOrderRef"  @onSubmitFn="qixianSuccessFn2"       :selectOrderNo="selectOrderNo" :isAdd="true"
      ></SelectOrderIndex>

    </div>
    <Modal v-model:visible="applyViewShow" title="是否删除该排产记录？" @ok="removeMainPlanFn">
      <div>
        <p v-for="(item, index) in selectOrderNo">订单标识号:{{ item }} </p>
      </div>
    </Modal>


    <vxe-modal v-model="applyViewShow2" title="请选择库位" :width="600" :height="400" esc-closable>
      <div>
        <vxe-form
          ref="formRef"
          :data="formData2"
          size="small"
          @submit="submitEvent2"
          @reset="resetEvent2">

          <vxe-form-item title="库位" field="tagText" span="24" :item-render="{}">
            <template #default="params">
              <vxe-select v-model="formData2.tagText">
                <vxe-option value="A" label="A"></vxe-option>
                <vxe-option value="B" label="B"></vxe-option>
                <vxe-option value="C" label="C"></vxe-option>
                <vxe-option value="D" label="D"></vxe-option>
                <vxe-option value="E" label="E"></vxe-option>
                <vxe-option value="F" label="F"></vxe-option>
              </vxe-select>
            </template>

          </vxe-form-item>
          <vxe-form-item align="center" span="24" :item-render="{}">
            <template #default>
              <vxe-button type="submit" status="primary" content="提交"></vxe-button>
              <vxe-button type="reset" content="重置"></vxe-button>
            </template>
          </vxe-form-item>

        </vxe-form>
      </div>
    </vxe-modal>

  </div>


</template>
<script lang="ts" setup>
import {
  BasicTableProps,
  VxeBasicTable,
  VxeGridInstance,
  VxeTableDefines,
} from '@/components/VxeTable';
import SelectOrderIndex from '@/views/dkn/components/formSelectTable/order/SelectOrderIndex.vue';
import { VxeUI } from 'vxe-pc-ui'

import { BasicTable, useTable, TableAction } from '@/components/Table';
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';

import { useDrawer } from '@/components/Drawer';
import util from "@/utils/util";
import {computed, onMounted, reactive, ref,watch} from 'vue';
import dayjs from 'dayjs';
import { useMessage } from "@/hooks/web/useMessage";
import {RangePicker, Divider, InputNumber, Modal,Anchor} from 'ant-design-vue';
import { useGo } from "@/hooks/web/usePage";
import {vxeTableColumns,baseColumns} from "./role.data";
import { router } from '@/router';

import {getMainPlan, productionPlanAdd, removeMainPlan,getDateRangeItems} from '@/api/heng/dkn';
import {useUserStore} from "@/store/modules/user";

const go = useGo();
const userStore = useUserStore();
const userName = userStore.getUserInfo?.userName;
const saveLoading=ref(false);//保存

const selectOrderRef=ref();//添加弹层
const qieXianOrderRef=ref();//切线弹层

const mainId= ref("");//computed(()=>router.currentRoute.value.params.mainId)
const contentHeight = ref(window.innerHeight);


defineOptions({ name: 'ywDeptList' });
const { createMessage } = useMessage();
const emit = defineEmits(['success', 'register','success2']);

// const [register, { openModal, closeModal }] = useModal();

// const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
//   //打开弹层后的回调
//
//   if(data?.mainId){
//     mainId.value=data?.mainId;
//     detailFn();
//   }else{
//     mainId.value=null;
//     resetEvent();
//   }
//
// });

onMounted(()=>{
  // console.log("--onMounted:",router.currentRoute.value)
  if(router.currentRoute.value.params?.mainId){
    mainId.value=router.currentRoute.value.params.mainId;
    detailFn();
  }else{
    resetEvent();
  }

})
// 监听路由参数变化，触发初始化
watch(
  () => router.currentRoute.value.params,
  (newParams) => {
    // 路由参数变化后的初始化逻辑
   // console.log('参数更新：', router.currentRoute)
    if(newParams&&newParams.mainId){
      mainId.value=newParams.mainId;
      detailFn();
    }else{
     // resetEvent();
    }
  },
  { immediate: true } // 初始挂载时也执行一次
)



const gridOptions = reactive<BasicTableProps>({
  // keepSource: true,
  editConfig: { trigger: 'click', mode: 'cell', showStatus: true },
  border: true,
  showOverflow: true,
  size: 'mini',
  height: 'auto', // 'auto'
  columns: vxeTableColumns,
  filterConfig: {
    remote: true,
  },
  showFooter: true,
  footerData: [
    { from: '合计', num: 0 }
  ],
  toolbarConfig: {
    // slots: {
    //   buttons: 'toolbar_buttons',
    // },
    // zoom:false,
    // export:false,
    // print:false,
    // refresh:false,
    // custom:false,

    enabled: false,
  },
  rowClassName: "f-8",
  headerRowClassName: "f-8",
  headerCellClassName: "f-8",
  formConfig: {
    enabled: false,
  },
  pagerConfig: {
    enabled: false,
  },
  proxyConfig: {
    enabled: false,
  },
});


let vxeTableColumns1= util.copy(baseColumns);
vxeTableColumns1[0].title="1线";
let vxeTableColumns2= util.copy(baseColumns);
vxeTableColumns2[0].title="2线";
// let vxeTableColumns3= util.copy(baseColumns);
// vxeTableColumns3[0].title="3线";
// let vxeTableColumns4= util.copy(baseColumns);
// vxeTableColumns4[0].title="4线";


let base_options=<BasicTableProps>{
  // keepSource: true,
  editConfig: { trigger: 'click', mode: 'cell', showStatus: true },
  border: true,
  showOverflow: true,
  size: 'mini',
  height: 'auto', // 'auto'
  columns: vxeTableColumns1,
  filterConfig: {
    remote: true,
  },
  showFooter: true,
  footerData: [
    { timeRank: '合计', num: 0 }
  ],
  exportConfig:{},
  toolbarConfig: {
    slots: {
      buttons: 'toolbar_buttons',
    },

  },
  rowClassName: "f-8",
  headerRowClassName: "f-8",
  headerCellClassName: "f-8",
  // layouts:{[ ['Toolbar']]},
  formConfig: {
    enabled: false,
  },
  pagerConfig: {
    enabled: false,
  },
  proxyConfig: {
    enabled: false,
  },
};

let options1= util.copy(base_options);
options1.columns=vxeTableColumns1;
let options2= util.copy(base_options);
options2.columns=vxeTableColumns2;
// let options3= util.copy(base_options);
// options3.columns=vxeTableColumns3;
// let options4= util.copy(base_options);
// options4.columns=vxeTableColumns4;
const gridOptions1 = reactive<BasicTableProps>(options1);
const gridOptions2 = reactive<BasicTableProps>(options2);
// const gridOptions3 = reactive<BasicTableProps>(options3);
// const gridOptions4 = reactive<BasicTableProps>(options4);

//表格行数据类型规范
interface item_em{
  biaoShiHao:string,
  model:string,//型号
  guige:string,//规格 颜色
  thisNum:number, //本次排查量
  allType?:number,//allType 是否能够完全被分配 1 完全 0 有剩余时间可被分配其他 产品
  qieXian?:number,//1已切线
  num?:number,//计算排产的数量
}

//上一次 选择的切线 行，是从哪行开始切线的
interface qie_xian_em{
  data?:item_em,//上一行的数据
  p_index?:number,//最外层数组下班
  rowIndex?:number,//开始切线那行的下标
  arr_name?:string,//产线名称
}

const loading=ref(false);
const msgList = ref([]);
// const mainId=ref("");//主记录id
const dataList2=ref([]);

const planDateList=ref([]);//计划日期区间
const selectOrderNo=ref([]);//已选单号
const dis_click_jiaban=ref(false);//加班按钮能否被点击

const qie_xian_obj=ref(<qie_xian_em>{});//选择切线的数据存储

const biaoji_obj=ref(<qie_xian_em>{});//标记对象的数据存储

const add_obj=ref(<qie_xian_em>{});//点击添加的数据存储

const applyViewShow = ref(false);

const tableRef = ref<VxeGridInstance>();

const formData=ref({
  date_rang:[],
  qieNum:10,
  show:false
});

const applyViewShow2 = ref(false);
const formData2=ref({})


function findPageList(page, form, filterList?: VxeTableDefines.FilterCheckedParams<any>[]) {
  let json = {};
  if (filterList && filterList.length) {
    filterList.forEach((e) => {
      const value = e.datas[0];
      let field = e.field;
      json[field ] = value;
    });
  }
}



function initFn(){
  // createFn(['2025-09-20','2025-09-21'])
 // testInitFn();
}

function testInitFn(){
  // createFn(['2025-09-20','2025-09-21'])
  let planDateList_s=null;
  planDateList_s="[{\"date\":\"2025-11-11\",\"iz_xiu_xi\":false,\"iz_jia_ban\":false,\"no_select_jiaban\":true,\"iz_add1\":false,\"iz_add2\":false,\"footData\":{\"100\":3600,\"200_500\":2880,\"step\":2243,\"K950\":323,\"arr1_total\":3600,\"arr2_total\":2880},\"sunday\":false,\"sun_do\":false,\"left_arr1\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"left_arr2\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"arr1\":[{\"no\":\"FJTZ-202509-0123\",\"biaoShiHao\":\"W2509040001\",\"thisNum\":4560,\"planDate\":\"2025-11-05 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-09-25 11:18:40\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"8:00-9:00\",\"num\":450,\"allType\":1,\"_X_ROW_KEY\":\"row_681\"},{\"no\":\"FJTZ-202509-0123\",\"biaoShiHao\":\"W2509040001\",\"thisNum\":4110,\"planDate\":\"2025-11-05 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-09-25 11:18:40\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"9:00-10:00\",\"num\":450,\"allType\":1,\"_X_ROW_KEY\":\"row_682\"},{\"no\":\"FJTZ-202509-0123\",\"biaoShiHao\":\"W2509040001\",\"thisNum\":3660,\"planDate\":\"2025-11-05 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-09-25 11:18:40\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"10:10-11:00\",\"num\":375,\"allType\":1,\"_X_ROW_KEY\":\"row_683\"},{\"no\":\"FJTZ-202509-0123\",\"biaoShiHao\":\"W2509040001\",\"thisNum\":3285,\"planDate\":\"2025-11-05 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-09-25 11:18:40\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"11:00-11:50\",\"num\":375,\"allType\":1,\"_X_ROW_KEY\":\"row_684\"},{\"no\":\"FJTZ-202509-0123\",\"biaoShiHao\":\"W2509040001\",\"thisNum\":2910,\"planDate\":\"2025-11-05 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-09-25 11:18:40\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"13:10-14:00\",\"num\":375,\"allType\":1,\"_X_ROW_KEY\":\"row_685\"},{\"no\":\"FJTZ-202509-0123\",\"biaoShiHao\":\"W2509040001\",\"thisNum\":2535,\"planDate\":\"2025-11-05 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-09-25 11:18:40\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"14:00-15:00\",\"num\":450,\"allType\":1,\"_X_ROW_KEY\":\"row_686\"},{\"no\":\"FJTZ-202509-0123\",\"biaoShiHao\":\"W2509040001\",\"thisNum\":2085,\"planDate\":\"2025-11-05 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-09-25 11:18:40\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"15:00-15:30\",\"num\":225,\"allType\":1,\"_X_ROW_KEY\":\"row_687\"},{\"no\":\"FJTZ-202509-0123\",\"biaoShiHao\":\"W2509040001\",\"thisNum\":1860,\"planDate\":\"2025-11-05 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-09-25 11:18:40\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"15:40-16:00\",\"num\":150,\"allType\":1,\"_X_ROW_KEY\":\"row_688\"},{\"no\":\"FJTZ-202509-0123\",\"biaoShiHao\":\"W2509040001\",\"thisNum\":1710,\"planDate\":\"2025-11-05 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-09-25 11:18:40\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"16:00-17:00\",\"num\":450,\"allType\":1,\"_X_ROW_KEY\":\"row_689\"},{\"no\":\"FJTZ-202509-0123\",\"biaoShiHao\":\"W2509040001\",\"thisNum\":1260,\"planDate\":\"2025-11-05 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-09-25 11:18:40\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"17:00-17:40\",\"num\":300,\"allType\":1,\"_X_ROW_KEY\":\"row_690\"}],\"arr2\":[{\"no\":\"FJTZ-202509-0022\",\"biaoShiHao\":\"W2509008003\",\"thisNum\":3600,\"planDate\":\"2025-10-13 00:00:00\",\"requireDate\":\"2025-11-17 00:00:00\",\"guige\":\"黑色\",\"model\":\"W500M\",\"createTime\":\"2025-09-04 23:29:55\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"8:00-9:00\",\"num\":360,\"allType\":1,\"_X_ROW_KEY\":\"row_853\"},{\"no\":\"FJTZ-202509-0022\",\"biaoShiHao\":\"W2509008003\",\"thisNum\":3240,\"planDate\":\"2025-10-13 00:00:00\",\"requireDate\":\"2025-11-17 00:00:00\",\"guige\":\"黑色\",\"model\":\"W500M\",\"createTime\":\"2025-09-04 23:29:55\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"9:00-10:00\",\"num\":360,\"allType\":1,\"_X_ROW_KEY\":\"row_854\"},{\"no\":\"FJTZ-202509-0022\",\"biaoShiHao\":\"W2509008003\",\"thisNum\":2880,\"planDate\":\"2025-10-13 00:00:00\",\"requireDate\":\"2025-11-17 00:00:00\",\"guige\":\"黑色\",\"model\":\"W500M\",\"createTime\":\"2025-09-04 23:29:55\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"10:10-11:00\",\"num\":300,\"allType\":1,\"_X_ROW_KEY\":\"row_855\"},{\"no\":\"FJTZ-202509-0022\",\"biaoShiHao\":\"W2509008003\",\"thisNum\":2580,\"planDate\":\"2025-10-13 00:00:00\",\"requireDate\":\"2025-11-17 00:00:00\",\"guige\":\"黑色\",\"model\":\"W500M\",\"createTime\":\"2025-09-04 23:29:55\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"11:00-11:50\",\"num\":300,\"allType\":1,\"_X_ROW_KEY\":\"row_856\"},{\"no\":\"FJTZ-202509-0022\",\"biaoShiHao\":\"W2509008003\",\"thisNum\":2280,\"planDate\":\"2025-10-13 00:00:00\",\"requireDate\":\"2025-11-17 00:00:00\",\"guige\":\"黑色\",\"model\":\"W500M\",\"createTime\":\"2025-09-04 23:29:55\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"13:10-14:00\",\"num\":300,\"allType\":1,\"_X_ROW_KEY\":\"row_857\"},{\"no\":\"FJTZ-202509-0022\",\"biaoShiHao\":\"W2509008003\",\"thisNum\":1980,\"planDate\":\"2025-10-13 00:00:00\",\"requireDate\":\"2025-11-17 00:00:00\",\"guige\":\"黑色\",\"model\":\"W500M\",\"createTime\":\"2025-09-04 23:29:55\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"14:00-15:00\",\"num\":360,\"allType\":1,\"_X_ROW_KEY\":\"row_858\"},{\"no\":\"FJTZ-202509-0022\",\"biaoShiHao\":\"W2509008003\",\"thisNum\":1620,\"planDate\":\"2025-10-13 00:00:00\",\"requireDate\":\"2025-11-17 00:00:00\",\"guige\":\"黑色\",\"model\":\"W500M\",\"createTime\":\"2025-09-04 23:29:55\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"15:00-15:30\",\"num\":180,\"allType\":1,\"_X_ROW_KEY\":\"row_859\"},{\"no\":\"FJTZ-202509-0022\",\"biaoShiHao\":\"W2509008003\",\"thisNum\":1440,\"planDate\":\"2025-10-13 00:00:00\",\"requireDate\":\"2025-11-17 00:00:00\",\"guige\":\"黑色\",\"model\":\"W500M\",\"createTime\":\"2025-09-04 23:29:55\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"15:40-16:00\",\"num\":120,\"allType\":1,\"_X_ROW_KEY\":\"row_860\"},{\"no\":\"FJTZ-202509-0022\",\"biaoShiHao\":\"W2509008003\",\"thisNum\":1320,\"planDate\":\"2025-10-13 00:00:00\",\"requireDate\":\"2025-11-17 00:00:00\",\"guige\":\"黑色\",\"model\":\"W500M\",\"createTime\":\"2025-09-04 23:29:55\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"16:00-17:00\",\"num\":360,\"allType\":1,\"_X_ROW_KEY\":\"row_861\"},{\"no\":\"FJTZ-202509-0022\",\"biaoShiHao\":\"W2509008003\",\"thisNum\":960,\"planDate\":\"2025-10-13 00:00:00\",\"requireDate\":\"2025-11-17 00:00:00\",\"guige\":\"黑色\",\"model\":\"W500M\",\"createTime\":\"2025-09-04 23:29:55\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-11\",\"timeRank\":\"17:00-17:40\",\"num\":240,\"allType\":1,\"_X_ROW_KEY\":\"row_862\"}],\"iz_add\":false},{\"date\":\"2025-11-12\",\"iz_xiu_xi\":false,\"iz_jia_ban\":false,\"no_select_jiaban\":true,\"iz_add1\":false,\"iz_add2\":true,\"footData\":{\"100\":3600,\"200_500\":2880,\"step\":2243,\"K950\":323,\"arr1_total\":3285,\"arr2_total\":720},\"sunday\":false,\"sun_do\":false,\"left_arr1\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true,\"now_shengyu_shijian\":32,\"needCountTime\":1,\"huan_han\":false},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"left_arr2\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"arr1\":[{\"no\":\"FJTZ-202509-0123\",\"biaoShiHao\":\"W2509040001\",\"thisNum\":960,\"planDate\":\"2025-11-05 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-09-25 11:18:40\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-12\",\"timeRank\":\"8:00-9:00\",\"num\":450,\"allType\":1,\"_X_ROW_KEY\":\"row_691\"},{\"no\":\"FJTZ-202509-0123\",\"biaoShiHao\":\"W2509040001\",\"thisNum\":510,\"planDate\":\"2025-11-05 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-09-25 11:18:40\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-12\",\"timeRank\":\"9:00-10:00\",\"num\":450,\"allType\":1,\"_X_ROW_KEY\":\"row_692\"},{\"no\":\"FJTZ-202509-0123\",\"biaoShiHao\":\"W2509040001\",\"thisNum\":60,\"planDate\":\"2025-11-05 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-09-25 11:18:40\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-12\",\"timeRank\":\"10:10-11:00\",\"num\":60,\"qieXian\":1,\"_X_ROW_KEY\":\"row_693\",\"num2\":240,\"model2\":\"W100\",\"biaoShiHao2\":\"W2510020001\",\"guige2\":\"黑色\",\"qieXianOver\":true},{\"no\":\"FJTZ-202510-0058\",\"biaoShiHao\":\"W2510020001\",\"thisNum\":4320,\"planDate\":\"2025-11-12 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-10-16 19:09:46\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-12\",\"timeRank\":\"11:00-11:50\",\"num\":375,\"_X_ROW_KEY\":\"row_840\"},{\"no\":\"FJTZ-202510-0058\",\"biaoShiHao\":\"W2510020001\",\"thisNum\":3945,\"planDate\":\"2025-11-12 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-10-16 19:09:46\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-12\",\"timeRank\":\"13:10-14:00\",\"num\":375,\"_X_ROW_KEY\":\"row_841\"},{\"no\":\"FJTZ-202510-0058\",\"biaoShiHao\":\"W2510020001\",\"thisNum\":3570,\"planDate\":\"2025-11-12 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-10-16 19:09:46\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-12\",\"timeRank\":\"14:00-15:00\",\"num\":450,\"_X_ROW_KEY\":\"row_842\"},{\"no\":\"FJTZ-202510-0058\",\"biaoShiHao\":\"W2510020001\",\"thisNum\":3120,\"planDate\":\"2025-11-12 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-10-16 19:09:46\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-12\",\"timeRank\":\"15:00-15:30\",\"num\":225,\"_X_ROW_KEY\":\"row_843\"},{\"no\":\"FJTZ-202510-0058\",\"biaoShiHao\":\"W2510020001\",\"thisNum\":2895,\"planDate\":\"2025-11-12 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-10-16 19:09:46\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-12\",\"timeRank\":\"15:40-16:00\",\"num\":150,\"_X_ROW_KEY\":\"row_844\"},{\"no\":\"FJTZ-202510-0058\",\"biaoShiHao\":\"W2510020001\",\"thisNum\":2745,\"planDate\":\"2025-11-12 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-10-16 19:09:46\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-12\",\"timeRank\":\"16:00-17:00\",\"num\":450,\"_X_ROW_KEY\":\"row_845\"},{\"no\":\"FJTZ-202510-0058\",\"biaoShiHao\":\"W2510020001\",\"thisNum\":2295,\"planDate\":\"2025-11-12 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-10-16 19:09:46\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-12\",\"timeRank\":\"17:00-17:40\",\"num\":300,\"_X_ROW_KEY\":\"row_846\"}],\"arr2\":[{\"no\":\"FJTZ-202509-0022\",\"biaoShiHao\":\"W2509008003\",\"thisNum\":720,\"planDate\":\"2025-10-13 00:00:00\",\"requireDate\":\"2025-11-17 00:00:00\",\"guige\":\"黑色\",\"model\":\"W500M\",\"createTime\":\"2025-09-04 23:29:55\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-12\",\"timeRank\":\"8:00-9:00\",\"num\":360,\"allType\":1,\"_X_ROW_KEY\":\"row_863\"},{\"no\":\"FJTZ-202509-0022\",\"biaoShiHao\":\"W2509008003\",\"thisNum\":360,\"planDate\":\"2025-10-13 00:00:00\",\"requireDate\":\"2025-11-17 00:00:00\",\"guige\":\"黑色\",\"model\":\"W500M\",\"createTime\":\"2025-09-04 23:29:55\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-12\",\"timeRank\":\"9:00-10:00\",\"num\":360,\"allType\":1,\"qieXian\":1,\"_X_ROW_KEY\":\"row_864\"}],\"iz_add\":false},{\"date\":\"2025-11-13\",\"iz_xiu_xi\":false,\"iz_jia_ban\":false,\"no_select_jiaban\":false,\"iz_add1\":true,\"iz_add2\":true,\"footData\":{\"100\":3600,\"200_500\":2880,\"step\":2243,\"K950\":323,\"arr1_total\":1995,\"arr2_total\":0},\"sunday\":false,\"sun_do\":false,\"left_arr1\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"left_arr2\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"arr1\":[{\"no\":\"FJTZ-202510-0058\",\"biaoShiHao\":\"W2510020001\",\"thisNum\":1995,\"planDate\":\"2025-11-12 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-10-16 19:09:46\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-13\",\"timeRank\":\"8:00-9:00\",\"num\":450,\"_X_ROW_KEY\":\"row_847\"},{\"no\":\"FJTZ-202510-0058\",\"biaoShiHao\":\"W2510020001\",\"thisNum\":1545,\"planDate\":\"2025-11-12 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-10-16 19:09:46\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-13\",\"timeRank\":\"9:00-10:00\",\"num\":450,\"_X_ROW_KEY\":\"row_848\"},{\"no\":\"FJTZ-202510-0058\",\"biaoShiHao\":\"W2510020001\",\"thisNum\":1095,\"planDate\":\"2025-11-12 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-10-16 19:09:46\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-13\",\"timeRank\":\"10:10-11:00\",\"num\":375,\"_X_ROW_KEY\":\"row_849\"},{\"no\":\"FJTZ-202510-0058\",\"biaoShiHao\":\"W2510020001\",\"thisNum\":720,\"planDate\":\"2025-11-12 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-10-16 19:09:46\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-13\",\"timeRank\":\"11:00-11:50\",\"num\":375,\"_X_ROW_KEY\":\"row_850\"},{\"no\":\"FJTZ-202510-0058\",\"biaoShiHao\":\"W2510020001\",\"thisNum\":345,\"planDate\":\"2025-11-12 00:00:00\",\"requireDate\":\"2025-12-01 00:00:00\",\"guige\":\"黑色\",\"model\":\"W100\",\"createTime\":\"2025-10-16 19:09:46\",\"mainId\":null,\"closeId\":null,\"startTime\":null,\"endTime\":null,\"date\":\"2025-11-13\",\"timeRank\":\"13:10-14:00\",\"num\":345,\"qieXian\":1,\"_X_ROW_KEY\":\"row_851\"}],\"arr2\":[],\"iz_add\":false},{\"date\":\"2025-11-14\",\"iz_xiu_xi\":false,\"iz_jia_ban\":false,\"no_select_jiaban\":false,\"iz_add1\":true,\"iz_add2\":true,\"footData\":{\"100\":3600,\"200_500\":2880,\"step\":2243,\"K950\":323,\"arr1_total\":0,\"arr2_total\":0},\"sunday\":false,\"sun_do\":false,\"left_arr1\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"left_arr2\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"arr1\":[],\"arr2\":[]},{\"date\":\"2025-11-15\",\"iz_xiu_xi\":false,\"iz_jia_ban\":false,\"no_select_jiaban\":false,\"iz_add1\":true,\"iz_add2\":true,\"footData\":{\"100\":3600,\"200_500\":2880,\"step\":2243,\"K950\":323,\"arr1_total\":0,\"arr2_total\":0},\"sunday\":false,\"sun_do\":false,\"left_arr1\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"left_arr2\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"arr1\":[],\"arr2\":[]},{\"date\":\"2025-11-16\",\"iz_xiu_xi\":false,\"iz_jia_ban\":false,\"no_select_jiaban\":false,\"iz_add1\":true,\"iz_add2\":true,\"footData\":{\"100\":3600,\"200_500\":2880,\"step\":2243,\"K950\":323,\"arr1_total\":0,\"arr2_total\":0},\"sunday\":true,\"sun_do\":false,\"left_arr1\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"left_arr2\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"arr1\":[],\"arr2\":[]},{\"date\":\"2025-11-17\",\"iz_xiu_xi\":false,\"iz_jia_ban\":false,\"no_select_jiaban\":false,\"iz_add1\":true,\"iz_add2\":true,\"footData\":{\"100\":3600,\"200_500\":2880,\"step\":2243,\"K950\":323,\"arr1_total\":0,\"arr2_total\":0},\"sunday\":false,\"sun_do\":false,\"left_arr1\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"left_arr2\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"arr1\":[],\"arr2\":[]},{\"date\":\"2025-11-18\",\"iz_xiu_xi\":false,\"iz_jia_ban\":false,\"no_select_jiaban\":false,\"iz_add1\":true,\"iz_add2\":true,\"footData\":{\"100\":3600,\"200_500\":2880,\"step\":2243,\"K950\":323,\"arr1_total\":0,\"arr2_total\":0},\"sunday\":false,\"sun_do\":false,\"left_arr1\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"left_arr2\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"arr1\":[],\"arr2\":[]},{\"date\":\"2025-11-19\",\"iz_xiu_xi\":false,\"iz_jia_ban\":false,\"no_select_jiaban\":false,\"iz_add1\":true,\"iz_add2\":true,\"footData\":{\"100\":3600,\"200_500\":2880,\"step\":2243,\"K950\":323,\"arr1_total\":0,\"arr2_total\":0},\"sunday\":false,\"sun_do\":false,\"left_arr1\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"left_arr2\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"arr1\":[],\"arr2\":[]},{\"date\":\"2025-11-20\",\"iz_xiu_xi\":false,\"iz_jia_ban\":false,\"no_select_jiaban\":false,\"iz_add1\":true,\"iz_add2\":true,\"footData\":{\"100\":3600,\"200_500\":2880,\"step\":2243,\"K950\":323,\"arr1_total\":0,\"arr2_total\":0},\"sunday\":false,\"sun_do\":false,\"left_arr1\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"left_arr2\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"arr1\":[],\"arr2\":[]},{\"date\":\"2025-11-21\",\"iz_xiu_xi\":false,\"iz_jia_ban\":false,\"no_select_jiaban\":false,\"iz_add1\":true,\"iz_add2\":true,\"footData\":{\"100\":3600,\"200_500\":2880,\"step\":2243,\"K950\":323,\"arr1_total\":0,\"arr2_total\":0},\"sunday\":false,\"sun_do\":false,\"left_arr1\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"left_arr2\":[{\"100\":450,\"from\":\"8:00\",\"to\":\"9:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"9:00\",\"to\":\"10:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"10:10\",\"to\":\"11:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"11:00\",\"to\":\"11:50\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":375,\"from\":\"13:10\",\"to\":\"14:00\",\"duration\":50,\"200_500\":300,\"step\":234,\"K950\":34,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"14:00\",\"to\":\"15:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":225,\"from\":\"15:00\",\"to\":\"15:30\",\"duration\":30,\"200_500\":180,\"step\":140,\"K950\":20,\"iz_zc_ban\":true},{\"100\":150,\"from\":\"15:40\",\"to\":\"16:00\",\"duration\":20,\"200_500\":120,\"step\":94,\"K950\":14,\"iz_zc_ban\":true},{\"100\":450,\"from\":\"16:00\",\"to\":\"17:00\",\"duration\":60,\"200_500\":360,\"step\":280,\"K950\":40,\"iz_zc_ban\":true},{\"100\":300,\"from\":\"17:00\",\"to\":\"17:40\",\"duration\":40,\"200_500\":240,\"step\":187,\"K950\":27,\"iz_zc_ban\":true}],\"arr1\":[],\"arr2\":[]}]"
  formData.value={
    date_rang:['2025-11-11', '2025-11-21'],
    qieNum:10,
    show:false};
  selectOrderNo.value=['W2509040001',  'W2510020001', 'W2509008003'];//W2510010001
  planDateList.value=JSON.parse(planDateList_s);


}

function detailFn(){
  getMainPlan({mainId:mainId.value}).then(res=>{
    if(res.code==200){
      let dataJson=JSON.parse(res.data.txtJson);
      // console.log("----dataJson.planDateList:",dataJson.planDateList)
      planDateList.value=dataJson.planDateList;
      formData.value=dataJson.formData;
      selectOrderNo.value=dataJson.selectOrderNo;
      dis_click_jiaban.value=true;
      // createMessage.success(res.message);
    }else{

      createMessage.error(res.message);
    }
  });
}

function removeMainPlanFn(){
  removeMainPlan({mainId:mainId.value}).then(res=>{
    if(res.code==200){
      createMessage.success(res.message);
      applyViewShow.value = false;
      go(`/productionPlanIndex`);
      // closeDrawer();
      // emit('success');
    }else{
      createMessage.error(res.message);
    }
  });
}

function submitEvent({data}) {
  //console.log("--submitEvent:",data);

  const start = data.date_rang[0];
  const end = data.date_rang[1];
  const dates = getAllDatesBetween( start, end);
  // console.log(`从${start}到${end}的所有日期：`);
  //console.log(dates);

  getDateRangeItemsFn(dates);
}
function resetEvent(e){
  qie_xian_obj.value={};
  dis_click_jiaban.value=false;
  selectOrderNo.value=[];
  planDateList.value=[];
  formData.value={
    date_rang:[],
    qieNum:10,
    show:false
  };
  initFn();
}

function testFn(){
  // let local_planDateList= util.copy(planDateList.value);
  // console.log("---formData.value:")
  // console.log(formData.value);
  // console.log(selectOrderNo.value);
  // console.log(JSON.stringify(planDateList.value));
  // emit("success",{k:"s"});
  initFn()
}

function testFn2(){
  console.log(JSON.stringify(planDateList.value));
}
/**
 * iz_zc_ban 正常班
 */

var d_arr=[
  {"from": "8:00", "to": "9:00", "duration": 60, "100": 450, "200_500": 360, "step": 280, "K950": 40,iz_zc_ban:true,},
  {"from": "9:00", "to": "10:00", "duration": 60, "100": 450, "200_500": 360, "step": 280, "K950": 40,iz_zc_ban:true},
  {"from": "10:10", "to": "11:00", "duration": 50, "100": 375, "200_500": 300, "step": 234, "K950": 34,iz_zc_ban:true},
  {"from": "11:00", "to": "11:50", "duration": 50, "100": 375, "200_500": 300, "step": 234, "K950": 34,iz_zc_ban:true},
  {"from": "13:10", "to": "14:00", "duration": 50, "100": 375, "200_500": 300, "step": 234, "K950": 34,iz_zc_ban:true},
  {"from": "14:00", "to": "15:00", "duration": 60, "100": 450, "200_500": 360, "step": 280, "K950": 40,iz_zc_ban:true},
  {"from": "15:00", "to": "15:30", "duration": 30, "100": 225, "200_500": 180, "step": 140, "K950": 20,iz_zc_ban:true},
  {"from": "15:40", "to": "16:00", "duration": 20, "100": 150, "200_500": 120, "step": 94, "K950": 14,iz_zc_ban:true},
  {"from": "16:00", "to": "17:00", "duration": 60, "100": 450, "200_500": 360, "step": 280, "K950": 40,iz_zc_ban:true},

  // {"from": "17:00", "to": "17:20", "duration": 20, "100": 150, "200_500": 120, "step": 93, "K950": 13,iz_zc_ban:true},
];

/**  d_arr
 *   needCountTime:number,//1 需要重新计算时间
 */


var d_arr_1={"from": "17:00", "to": "17:40", "duration": 40, "100": 300, "200_500": 240, "step": 187, "K950": 27,iz_zc_ban:true};
var d_arr_2={"from": "17:00", "to": "17:20", "duration": 20, "100": 150, "200_500": 120, "step": 93, "K950": 13,iz_zc_ban:true};

var d_arr2=[
  {"from": "18:10", "to": "19:00", "duration": 50, "100": 375, "200_500": 300, "step": 233, "K950": 33,iz_zc_ban:false},
  {"from": "19:00", "to": "20:00", "duration": 60, "100": 450, "200_500": 360, "step": 280, "K950": 40,iz_zc_ban:false},
  {"from": "20:00", "to": "20:30", "duration": 30, "100": 225, "200_500": 180, "step": 140, "K950": 20,iz_zc_ban:false}
]

function createFn(dates){

  try{
    // console.log("---planItems.value:",planItems.value)
    let arr=[];
    let index=0;
    dates.forEach(date => {
      let left_arr=[...d_arr,d_arr_1];
      let footData={
        "100": 0, "200_500": 0, "step": 0, "K950": 0,
        arr1_total:0,
        arr2_total:0
      };
      let json={
        date,
        iz_xiu_xi:false,//是否休息
        iz_jia_ban:false,
        no_select_jiaban:false,//加班按钮是否可以点击
        iz_add1:true,//是否显示添加按钮
        iz_add2:true,//是否显示添加按钮
        footData,
        sunday: dayjs(date).day() === 0,// 周日 标识
        sun_do: false,//周日是否排班 (废弃)
        left_arr1:util.copy(left_arr) ,
        left_arr2:util.copy(left_arr) ,
        arr1:[],
        arr2:[]};

      for (let i = 0; i < planItems.value.length; i++) {
        let item=planItems.value[i];
        if(date==item.date){
          json=JSON.parse(item.planItemJson);
          if(json.arr1&&json.arr1.length==0){
            json.iz_add1=true;
          }
          if(json.arr2&&json.arr2.length==0){
            json.iz_add2=true;
          }
          // console.log("--替换 json："+item.planItemJson)
          break;
        }
      }

      countLeftArrFoot(json);
      // console.log("--统计尾部数据：",json)
      // console.log("--替换 json："+json)
      arr.push(json);

    });

    let arr1_last_index=null;

    let arr2_last_index=null;

    for (let i = 0; i < arr.length; i++) {
      let item = arr[i];
      if(item.arr1&&item.arr1.length>0&&item.arr1.length<item.left_arr1.length){
        if(arr1_last_index==null){

          let last_item=item.arr1[item.arr1.length-1];
          arr1_last_index=item.arr1.length-1;
          if(last_item){
            if(last_item.qieXian==1){
              last_item.qieXianOver=false
            }
          }else{
            createMessage.error("--下标1有误!")
          }

        }
      }
      if(item.arr2&&item.arr2.length>0&&item.arr2.length<item.left_arr2.length){

        if(arr2_last_index==null){

          let last_item=item.arr2[item.arr2.length-1];
          arr2_last_index=item.arr2.length-1;
          if(last_item){
            if(last_item.qieXian==1){
              last_item.qieXianOver=false
            }
          }else{
            createMessage.error("--下标2有误!")
          }
        }
      }

    }

    // arr[0].iz_add1=true;
    // arr[0].iz_add2=true;
    if(arr[0].arr1.length==0&&arr[0].arr2.length==0){
      arr[0].iz_add1=true;
      arr[0].iz_add2=true;
    }
    planDateList.value = arr;

    //数据备份
    backupFn();
  }catch(e){
    console.log(e);
    createMessage.error("错误信息:"+JSON.stringify(e));
  }
  loading.value=false;

}




/**
 * 获取从开始日期到结束日期之间的所有日期
 * @param {string|Date} startDate 开始日期
 * @param {string|Date} endDate 结束日期
 * @param {string} format 日期格式，默认'YYYY-MM-DD'
 * @returns {string[]} 包含所有日期的数组
 */
function getAllDatesBetween(startDate, endDate, format = 'YYYY-MM-DD') {
  // 转换为dayjs对象并设置为当天的起始时间
  let start = dayjs(startDate).startOf('day');
  let end = dayjs(endDate).startOf('day');

  // 验证日期有效性
  if (!start.isValid() || !end.isValid()) {
    throw new Error('无效的日期格式');
  }

  // 如果开始日期晚于结束日期，交换它们
  if (start.isAfter(end)) {
    [start, end] = [end, start];
  }

  const dates = [];
  let currentDate = start;

  // 循环添加所有日期直到超过结束日期（兼容旧版本dayjs）
  // 当currentDate在end之后时停止循环
  while (!currentDate.isAfter(end)) {
    dates.push(currentDate.format(format));
    currentDate = currentDate.add(1, 'day');
  }

  return dates;
}


function switchJiaBan(e,item){
  // console.log("---switchJiaBan:item:",item)
  let left_arr=[]
  if(e.value){
    left_arr=[...d_arr,d_arr_2,...d_arr2];
  }else{
    left_arr=[...d_arr,d_arr_1];
  }
  item.left_arr1=util.copy(left_arr);
  item.left_arr2=util.copy(left_arr);
  // let json={ "100": 0, "200_500": 0, "step": 0, "K950": 0};
  countLeftArrFoot(item);

}

//统计目标产能 尾部合计
function countLeftArrFoot(item){
  let n_100=0,n_200_500=0,step=0,K950=0;
  item.left_arr1.forEach(item => {
    n_100+=item['100'];
    n_200_500+=item['200_500'];
    step+=item['step'];
    K950+=item['K950'];
  })
  item.footData['100']=n_100;
  item.footData['200_500']=n_200_500;
  item.footData['step']=step;
  item.footData['K950']=K950;
}

function switchSunday(e,item,index){
  // console.log("---switchSunday:item:",item);
  // console.log("---e:",e.value);
 // let local_planDateList= util.copy(planDateList.value);

  let last_index=null;//周日上一个有没有数据
  if(index-1!>=0){
    last_index=index-1;
  }

  if(e.value){

    if(last_index!=null){
      let last_p_item=planDateList.value[last_index];
      if(last_p_item.arr1.length>1){
        item.arr1=[];
        item.iz_add1=true;
        item.iz_add2=false;

      }
      if(last_p_item.arr2.length>1){
        item.arr2=[];
        item.iz_add2=true;
        item.iz_add1=false;

      }
    }else{
      item.arr1=[];
      item.arr2=[];
      item.iz_add2=true;
      item.iz_add1=true;
    }


  }else{
    item.iz_add2=false;
    item.iz_add1=false;
    if(item.arr1.length==1){
      item.arr1=[]
    }
    if(item.arr2.length==1){
      item.arr2=[]
    }
  }


  //周日下一个还有没有日期
  if(index<planDateList.value.length-1){
     let next_p_item=planDateList.value[index+1];
    if(e.value){
      if(next_p_item.arr1.length==1){
        next_p_item.arr1=[]
      }
      if(next_p_item.arr2.length==1){
        next_p_item.arr2=[]
      }
    }else{

      // 上一个
      if(last_index!=null){
        let last_p_item=planDateList.value[last_index];
        if(last_p_item.arr1.length>1){
          if(next_p_item.arr1.length==0){
            next_p_item.arr1=[];
            next_p_item.iz_add1=true;

          }
          if(next_p_item.arr2.length>1){
            next_p_item.arr2=[];
            next_p_item.iz_add2=true;

          }
        }
      }

    }
  }

}

//操作记录
const operator_arr=ref([]);

const planItems=ref([]);//计划记录

// 点击添加
function clickAddFn(p_index,arr_name){
  add_obj.value={
    p_index,
    arr_name
  }
  selectOrderRef.value.openFn();
}

//1 新增
function addFirstFn(p_index,orderItem,arr_name){
  dis_click_jiaban.value=true;
  let modelJson =getCountModelJson()
  selectOrderNo.value.push(orderItem.biaoShiHao);
  let local_planDateList= util.copy(planDateList.value);
  local_planDateList[p_index].no_select_jiaban=true;//加班不可选
  if(arr_name=="arr1"){
    local_planDateList[p_index].iz_add1=false;
  }
  if(arr_name=="arr2"){
    local_planDateList[p_index].iz_add2=false;
  }
  let left_arr0=local_planDateList[p_index]?.[`left_${arr_name}`];
  let t_count_num=null;//目标产能
  let left_item0=left_arr0[0];
  for (let key in modelJson) {
    if (orderItem.model.includes(key)) {
      t_count_num = left_item0[modelJson[key]];
    }
  }
  for(let i=p_index;i<local_planDateList.length;i++) {
    let p_item = local_planDateList[i];
    p_item.iz_add=false;
    let left_arr = p_item[`left_${arr_name}`];
    // console.log("----i:"+i+"--p_item.sun_do:",p_item.sun_do,"---!p_item.sunday:",!p_item.sunday)
    if (!p_item.iz_xiu_xi) {//if (p_item.sun_do || !p_item.sunday)
      if(orderItem.thisNum<=0){
        break;//防止出现 中间一半分配完了，还给下一个日期第一个格子还是分配0的情况
      }
      /**
       * 产线表格
       * 初始化计算 --start
       */
      let child_arr=p_item[`${arr_name}`]||[];
      for(let i2=0;i2<left_arr.length;i2++){
        let count_num=null,count_num_old=null;//剩余目标产能，原目标产能


        let left_item=left_arr[i2];
        for (let key in modelJson) {
          //匹配型号 获取对应的产能
          if(orderItem.model.includes(key)){
            // 不是切线的逻辑
            count_num=left_item[modelJson[key]];
          }
        };
        if(!count_num){
          createMessage.error("获取不到目标产能,该型号 不在名单中！");
          dis_click_jiaban.value=false;
          return
        }
        /**
         * 当前行的剩余产能
         */
        let child_item={...orderItem};
        child_item.date=p_item.date;
        delete child_item._X_ROW_KEY;
        child_item.timeRank=`${left_item.from}-${left_item.to}`;

        // console.log("---orderItem.thisNum:",orderItem.thisNum,"---count_num:",count_num,"---left_item:",left_item);
        // if(i2==left_arr.length-1){
        //
        // }
        if(count_num>=0){

          //TODO 剩余产能 大于=0的情况
          if(orderItem.thisNum-count_num>0){
            // console.log("---count_num:",count_num);

            let num=orderItem.thisNum-count_num;
            // console.log("---得出结果 num",num)
            orderItem.thisNum=num;
            child_item.num=count_num;


          }else{
            // debugger
            let num=orderItem.thisNum;
            // 还有一些没做完
            child_item.num=num;
            orderItem.thisNum=0;
          }
        }else{
          child_item.num=count_num_old;


        }

        if(child_item.num){

          if(child_item.num==count_num){
            child_item.allType=1;//allType 是否能够完全被分配 1 完全 0 有剩余时间可被分配其他 产品
          }
          if(orderItem.thisNum==0){
            child_item.qieXian=1;

            if(i2==left_arr.length-1){

              if(child_item.allType==1&&child_item.qieXian==1){
              //  child_item.qieXian=0; //这个表格刚刚到最后一行又全部分配完成， child_item.allType==1&&child_item.qieXian==1

                //判断下一个日期还能再分配
                let next_index=null;//获取还有没有 下一个能分配的日期
                let next_count_index=p_index+1;
                if(next_count_index<= local_planDateList.length-1){
                  for(let ii=next_count_index;ii<local_planDateList.length;ii++) {
                    let next_p_item = local_planDateList[ii];
                    if(!next_p_item.iz_xiu_xi){//next_p_item.sun_do||!next_p_item.sunday
                      next_index=ii;
                    }
                    if(next_index){
                      // TODO 下个日期的第一行设置请选择按钮
                      // next_p_item[`${arr_name}`].push({izNull:1});//让他可以选择订单标识号
                      break;
                    }
                  }
                };
                if(next_index) {
                  let next_p_item = local_planDateList[next_index];
                  if(arr_name=="arr1"){
                    next_p_item.iz_add1=false;
                  }
                  if(arr_name=="arr2"){
                    next_p_item.iz_add2=false;
                  }
                  let next_left_arr=next_p_item[`left_${arr_name}`];
                  let next_left_arr_item=next_left_arr[0];
                  let count_num1 = null;//目标产能

                  for (let key in modelJson) {
                    if (orderItem.model.includes(key)) {
                      count_num1 = next_left_arr_item[modelJson[key]];
                      //当前行剩余产能: (下行总时间-下行切线时间)*下行人均产能
                      let next_pingjun=count_num1/next_left_arr_item.duration;
                      let next_do_num= (next_left_arr_item.duration-formData.value.qieNum)*next_pingjun;

                      // left_item2[`${modelJson[key]}2`]= Math.round(next_do_num);
                      let formatNumber1 = formatNumber(next_do_num/next_pingjun);
                      //剩余时间
                      next_left_arr_item.next_shengyu_shijian= formatNumber1;
                      next_left_arr_item.needCountTime=1;
                      //console.log("---next_left_arr_item:",next_left_arr_item)
                      break;
                    }
                  }
                }


              }

              //判断下一个日期还能再分配
              let next_index=null;//获取还有没有 下一个能分配的日期
              let next_count_index=i+1;

              if(next_count_index<= local_planDateList.length-1&&i2==left_arr.length-1){
                for(let ii=next_count_index;ii<local_planDateList.length;ii++) {
                  let next_p_item = local_planDateList[ii];
                  if(!next_p_item.iz_xiu_xi){//next_p_item.sun_do||!next_p_item.sunday
                    next_index=ii;
                  }
                  if(next_index){
                    // TODO 下个日期的第一行设置请选择按钮
                    // next_p_item[`${arr_name}`].push({izNull:1});//让他可以选择订单标识号
                    break;
                  }
                }
              };

              if(next_index&&!child_item.qieXian){
                let next_p_item = local_planDateList[next_index];
                if(arr_name=="arr1"){
                  next_p_item.iz_add1=true;
                }
                if(arr_name=="arr2"){
                  next_p_item.iz_add2=true;
                }
              //  child_item.qieXian=0;

              }

            }else{

            }

          }

          child_arr.push(child_item);
        }

      }
      p_item[`${arr_name}`]=child_arr;

    }

    if(i==local_planDateList.length-1){
      // console.log("--有没有剩余:",orderItem.thisNum,"----i:",i)
      // 最后一个提示，剩余数据超出提示 废弃
      p_item[`${arr_name}_shengyu_num`]=orderItem.thisNum;
    }else{
      //下一个是周日，又没排班的话， 要提示
      let next_p_item=local_planDateList[i+1]
      if(!next_p_item.iz_xiu_xi){//next_p_item.sunday&&!next_p_item.sun_do
       // p_item[`${arr_name}_shengyu_num`]=orderItem.thisNum;

      }
    }


  }

  /**
   * 计算结束
   */
  /**
   * 统计 尾部合计
   */
  for(let i=p_index;i<local_planDateList.length;i++) {
    let p_item = local_planDateList[i];
    // let left_arr=p_item.left_arr;
    let arr1=p_item.arr1;
    let arr1_total=0,arr2_total=0;
    arr1.forEach((item,index)=>{
      if(item.num){
        arr1_total+=item.num;
      }
    })
    let arr2=p_item.arr2;
    arr2.forEach((item,index)=>{
      if(item.num){
        arr2_total+=item.num;
      }
    })
    p_item.footData.arr1_total=arr1_total;
    p_item.footData.arr2_total=arr2_total;
  }

  planDateList.value=local_planDateList


}

function addSuccessFn2(orderItem){
  const {
    p_index,
    arr_name
  }= add_obj.value;
  addFirstFn(p_index,orderItem,arr_name);
  backupFn();
}


//2 切线










/**
 *
 * @param orderItem x选择标识号弹层回来的数据
 * @param p_index
 * @param rowIndex
 * @param arr_name
 */

/**
 * 切线时 rowIndex有没有赋值给 i2 下标过，有赋值后就不在赋值
 * orderItem 是选择弹层的数据
 * lastRow 是上一行的数据
 * 场景：当出现 跨日期 但是生产数量还没被排产完，第二天的rowIndex 跟上一天的是一样的，如何解决？
 */
const index_2_set=ref(false);//


// 2 切线
function qieXianTableFn(orderItem,lastRow,p_index,rowIndex,arr_name){
  dis_click_jiaban.value=true;

  /**
   * 设置 切线 的商品名称
   */


  let modelJson =getCountModelJson()
  selectOrderNo.value.push(orderItem.biaoShiHao);

  /**
   * 扣除切线时间
   */

  // console.log("---iz_qie_cation:",iz_qie_cation)
  /**
   * 切线逻辑 26号
   * 1 判断加上切线10分钟会不会超出 当前 总时长：上一条的数量 所用了多少分钟+10分钟 是否大于 上一条总时长
   * 1-1 不会
   *      剩余分钟数=  总时长- 上一条的数量 所用了多少分钟 -10分钟
   *      剩余分钟数 是否大于 下一条的总时长，超出部分直接丢弃

   *        求当前能做多少个：剩余分钟数* 人均产能
   *  2-1 会 (切线分钟数会散落在上下两行)
   *       下行切线时间: 10分钟- 总时长- 上一条的数量 所用了多少分钟
   *       下行剩余产能: (下行总时间-下行切线时间)*下行人均产能
   *
   *
   *  切线 当天每次切线都要加10分钟,当天刚好做完,到第二天 刚开始的则不需要
   *  切线逻辑 27号: rowIndex 上一条下标
   *  1
   */
  let local_planDateList= util.copy(planDateList.value);
  let last_p_item=local_planDateList[p_index];
  last_p_item.no_select_jiaban=true;//加班不可选
  if(arr_name=="arr1"){
    last_p_item.iz_add1=false;
  }
  if(arr_name=="arr2"){
    last_p_item.iz_add2=false;
  }
  try{
    let last_arr= last_p_item[`${arr_name}`];
    last_arr[rowIndex].qieXianOver=true;//上个切线不可选
  }catch(e){
    createMessage.error(JSON.stringify(e));
  }


  let left_arr=last_p_item[`left_${arr_name}`];
  let left_item2=left_arr[rowIndex];
  let t_count_num1=null;//上行 目标产能
  // lastRow.qieXianOver=true;

  let model=null;
  model= lastRow.model;//拿上一行的型号
  let huan_han=false;//是否进行换行
  let huan_han_qieXianTime_notcount=false;//换行的时候 不需要扣除切线时间? 默认扣除 false,
  let huan_han_to_next_arr=false;//换行切换到下一个数组
  for (let key in modelJson) {
    if (model.includes(key)) {
      t_count_num1 = left_item2[modelJson[key]];
      break;
    }
  }
  if(t_count_num1>lastRow.num){
    /**
     * 没做完
     */
      // 上一条的平均产能
    let last_pingjun=t_count_num1/left_item2.duration;//每分钟平均产能
    let last_num=lastRow.num;//上一条  做工数量
    // 上一条的数量（lastRow.num）  所用了多少分钟 +10分钟
    let last_time=last_num/last_pingjun;//上一条的数量 所用了多少分钟
    // console.log("----上一条所用时间:",last_time)
    let last_total=last_time+formData.value.qieNum;
    // 是否超出上条总时间

    if(last_total<left_item2.duration) {
      huan_han=false;
      // 1-1 不会
      //  剩余分钟数=  总时长- 上一条的数量 所用了多少分钟 -10分钟
      let shengyu_shijian =left_item2.duration-last_total;
      //   剩余分钟数 是否大于 当前的总时长，超出部分直接丢弃
      let now_count_num1=null;//当前目标产能
      let model2=orderItem.model;

      for (let key in modelJson) {
        if(model2.includes(key)){
          now_count_num1=left_item2[modelJson[key]];
          //  剩余分钟数 是否大于 下一条的总时长，超出部分直接丢弃
          let now_pingjun=now_count_num1/left_item2.duration;
          // 求当前能做多少个：剩余时间* 当前人均产能
          let now_do_num=  shengyu_shijian*now_pingjun;
          let now_do_num_result=formatNumber(now_do_num);
          left_item2.now_shengyu_shijian=shengyu_shijian;
          left_item2.needCountTime=1;
          if(now_do_num_result>0){

          }else{
          //  left_item2[`${modelJson[key]}2`]= now_do_num_result;
            huan_han=true;
          }
          //  console.log("--left_item2.now_shengyu_shijian;")
          break;
        }
      };
    }else if(last_total>left_item2.duration){
      huan_han=true;
      // 2-1 会(切线分钟数会散落在上下两行)
      //下行切线时间: 10分钟- 总时长- 上一条的数量 所用了多少分钟
      let next_qie_shijian= last_total-left_item2.duration;
      //下行剩余产能: (下行总时间-下行切线时间)*下行人均产能
      //先获取当前行
      let my_now_index=null;
      for(let ii3=0;ii3<left_arr.length;ii3++){
        let now_item2=left_arr[ii3];
        if(lastRow.timeRank==(now_item2.from+"-"+now_item2.to)){
          my_now_index=ii3;
          break;
        }
      }
      // console.log("--my_now_index:",my_now_index);
      if((my_now_index+1)<=left_arr.length-1) {
        // console.log("--- 设置下一行产能 my_now_index:",my_now_index);
        let left_item = left_arr[my_now_index+1 ];//这边获取下行坐标有问题
        let count_num1 = null;//目标产能
        for (let key in modelJson) {
          if (orderItem.model.includes(key)) {
            count_num1 = left_item[modelJson[key]];
            //当前行剩余产能: (下行总时间-下行切线时间)*下行人均产能
            let next_pingjun=count_num1/left_item.duration;
            let next_do_num= (left_item.duration-next_qie_shijian)*next_pingjun;

           // left_item2[`${modelJson[key]}2`]= Math.round(next_do_num);
            let formatNumber1 = formatNumber(next_do_num/next_pingjun);
            //剩余时间
            left_item.next_shengyu_shijian= formatNumber1;
            left_item.needCountTime=1;
            rowIndex++;
            // console.log("---next_left_item.next_shengyu_shijian:",left_item.next_shengyu_shijian)
            break;
          }
        }
      }else{
        //判断下一个日期还能再分配
        let next_index=null;//获取还有没有 下一个能分配的日期
        let next_count_index=p_index+1;
        if(next_count_index<= local_planDateList.length-1){
          for(let ii=next_count_index;ii<local_planDateList.length;ii++) {
            let next_p_item = local_planDateList[ii];
            if(!next_p_item.iz_xiu_xi){//next_p_item.sun_do||!next_p_item.sunday
              next_index=ii;
            }
            if(next_index){
              // TODO 下个日期的第一行设置请选择按钮
              // next_p_item[`${arr_name}`].push({izNull:1});//让他可以选择订单标识号
              break;
            }
          }
        };
        if(next_index) {
          let next_p_item = local_planDateList[next_index];
          if(arr_name=="arr1"){
            next_p_item.iz_add1=false;
          }
          if(arr_name=="arr2"){
            next_p_item.iz_add2=false;
          }
          let next_left_arr=next_p_item[`left_${arr_name}`];
          let next_left_arr_item=next_left_arr[0];
          let count_num1 = null;//目标产能

          for (let key in modelJson) {
            if (orderItem.model.includes(key)) {
              count_num1 = next_left_arr_item[modelJson[key]];
              //当前行剩余产能: (下行总时间-下行切线时间)*下行人均产能
              let next_pingjun=count_num1/next_left_arr_item.duration;
              let next_do_num= (next_left_arr_item.duration-next_qie_shijian)*next_pingjun;

              // left_item2[`${modelJson[key]}2`]= Math.round(next_do_num);
              let formatNumber1 = formatNumber(next_do_num/next_pingjun);
              //剩余时间
              next_left_arr_item.next_shengyu_shijian= formatNumber1;
              next_left_arr_item.needCountTime=1;
              huan_han_to_next_arr=true;
              p_index+=1;
              rowIndex=0;
              //console.log("---next_left_arr_item:",next_left_arr_item)
              break;
            }
          }
        }
      }
    }else{
     // + 加上切线时间刚好等于 目标产能，换行时标记下行不需要再扣除切线时间了
      huan_han_qieXianTime_notcount=true;
      huan_han=true;
    }
  }else{
    // 上一行刚好做完
    //已做完
    huan_han=true;
    if(rowIndex+1<left_arr.length){
      //当前表格 还没到最后一条，下标+1
      rowIndex++;
    }else{
      //切换到下一个表格
      huan_han_to_next_arr=true;
      p_index+=1;
      rowIndex=0;
    }
  }

  left_item2.huan_han=huan_han;
  if(huan_han&&huan_han_qieXianTime_notcount){
    if(rowIndex+1<left_arr.length){
      left_arr[rowIndex+1].huan_han=huan_han;
      left_arr[rowIndex+1].huan_han_qieXianTime_notcount=huan_han_qieXianTime_notcount;
      rowIndex=rowIndex+1;
     // console.log("--换行下标+1")
    }
  }
  // if(huan_han&&huan_han_to_next_arr){
  //   p_index+=1;
  //   rowIndex=0;
  // }

  for (let key in modelJson) {
    if(model.includes(key)){

    }
  };
  for(let i=p_index;i<local_planDateList.length;i++){
    let p_item= local_planDateList[i];
    let left_arr=p_item[`left_${arr_name}`];
    // console.log("----i:"+i+"--p_item.sun_do:",p_item.sun_do,"---!p_item.sunday:",!p_item.sunday)
    if(!p_item.iz_xiu_xi){ //p_item.sun_do||!p_item.sunday
      /**
       * 产线表格
       * 初始化计算 --start
       */
      let child_arr=p_item[`${arr_name}`]||[];

      
      if(orderItem.thisNum<=0){
        // console.log("--orderItem.thisNum<=0:",orderItem.thisNum);
        break;//防止出现 中间一半分配完了，还给下一个日期第一个格子还是分配0的情况
      }
      let index_2=rowIndex;
      // 如果是切线的下标不能直接对应

      if(index_2_set.value){
        index_2=0;
      }


      for(let i2=index_2;i2<left_arr.length;i2++){
        let count_num=null,count_num_old=null;//剩余目标产能，原目标产能

        let left_item=left_arr[i2];
        for (let key in modelJson) {
          //匹配型号 获取对应的产能
          if(orderItem.model.includes(key)){
            count_num_old=left_item[modelJson[key]]
            let pingjun=count_num_old/left_item.duration;

            if(left_item.needCountTime){
              if(left_item.next_shengyu_shijian){
                let do_num= pingjun*left_item.next_shengyu_shijian;
                count_num=formatNumber(do_num);
              }
              if(left_item.now_shengyu_shijian){
                let do_num= pingjun*left_item.now_shengyu_shijian;
                count_num=formatNumber(do_num);
              }
            }else if(left_item.huan_han){
              let shenyu_shijian=left_item.duration-formData.value.qieNum;
              if(left_item.huan_han_qieXianTime_notcount){
                shenyu_shijian=left_item.duration;
              }
              let do_num= pingjun*shenyu_shijian;
              count_num=formatNumber(do_num);
            }else{
              count_num=left_item[modelJson[key]]
            }

          }
        };
        if(!count_num){
          createMessage.error("获取不到目标产能,该型号 不在名单中！");
          dis_click_jiaban.value=false;
          return
        }
        /**
         * 当前行的剩余产能
         */
        let child_item={...orderItem};
        delete child_item._X_ROW_KEY;
        child_item.date=p_item.date;
        child_item.timeRank=`${left_item.from}-${left_item.to}`;

        // console.log("---orderItem.thisNum:",orderItem.thisNum,"---count_num:",count_num,"---left_item:",left_item);

        if(count_num>=0){
          //TODO 剩余产能 大于=0的情况
          if(orderItem.thisNum-count_num>=0){
            // console.log("---count_num:",count_num);
            let num=orderItem.thisNum-count_num;
            // console.log("---得出结果 num",num)
            orderItem.thisNum=formatNumber(num);
            child_item.num=count_num;
          }else{
            // debugger
            let num=orderItem.thisNum;
            // console.log("---最终得出结果 num",num)
            child_item.num=formatNumber(num);
            orderItem.thisNum=0;
          }
        }else{
          //TODO 剩余产能是负数的情况 count_num=-30
          // if(orderItem.thisNum+count_num-count_num_old>0){
          //   let num=orderItem.thisNum+count_num-count_num_old;
          //   orderItem.thisNum=num;
          //   child_item.num=count_num_old;
          // }else{
          //   // debugger
          //   let num=orderItem.thisNum;
          //   // console.log("---最终得出结果 num",num)
          //   child_item.num=formatNumber(num);
          //
          //   orderItem.thisNum=0;
          // }
        }

        if(child_item.num){
          if(orderItem.thisNum==0){
            if(child_item.num==count_num){
              child_item.allType=1;
            }
            child_item.qieXian=1;
            //要添加还是切线
            if(i2==left_arr.length-1){

              // if(child_item.allType==1&&child_item.qieXian==1){
              //   child_item.qieXian=0;
              // }

              //判断下一个日期还能再分配
              let next_index=null;//获取还有没有 下一个能分配的日期
              let next_count_index=i+1;
              if(next_count_index<= local_planDateList.length-1&&i2==left_arr.length-1){
                for(let ii=next_count_index;ii<local_planDateList.length;ii++) {
                  let next_p_item = local_planDateList[ii];
                  if(!next_p_item.iz_xiu_xi){//next_p_item.sun_do||!next_p_item.sunday
                    next_index=ii;
                  }
                  if(next_index){
                    // TODO 下个日期的第一行设置请选择按钮
                    // next_p_item[`${arr_name}`].push({izNull:1});//让他可以选择订单标识号
                    break;
                  }
                }
              };
              if(next_index){
                let next_p_item = local_planDateList[next_index];
                if(arr_name=="arr1"){
                  next_p_item.iz_add1=true;
                }
                if(arr_name=="arr2"){
                  next_p_item.iz_add2=true;
                }
              }

            }

          }

          if(left_item.huan_han!=null&&left_item.huan_han==false){
            //TODO 设置切线2 属性
            lastRow.num2=child_item.num;
            lastRow.model2=orderItem.model;
            lastRow.biaoShiHao2=orderItem.biaoShiHao;
            lastRow.guige2=orderItem.guige;

            const {
              p_index,
              rowIndex,
              arr_name
            }= qie_xian_obj.value;
            let p_item =local_planDateList[p_index];
            let arr= p_item[`${arr_name}`];
            lastRow.qieXianOver=true;
            arr[rowIndex]=lastRow;
          }else{
            child_arr.push(child_item);
          }
          // console.log("---child_item:",child_item);
        }else{
          // console.log("---child_item null:",child_item);
        }

        if(orderItem.thisNum<=0){

          //还有下个时段 并且 刚刚上个时段已经做完了；如果这个时段  还可以有剩余被分配的时间则 用'切线的逻辑'
          //判断下一个日期还能再分配
          let next_index=null;//获取还有没有 下一个能分配的日期
          let next_count_index=i+1;

          if(next_count_index<= local_planDateList.length-1&&i2==left_arr.length-1){
            for(let ii=next_count_index;ii<local_planDateList.length;ii++) {
              let next_p_item = local_planDateList[ii];
              if(!next_p_item.iz_xiu_xi){//next_p_item.sun_do||!next_p_item.sunday
                next_index=ii;
              }
              if(next_index){
                // TODO 下个日期的第一行设置请选择按钮
                // next_p_item[`${arr_name}`].push({izNull:1});//让他可以选择订单标识号
                break;
              }
            }

          };
          //计算不下去了跳出循环
          break;
        }
        //let row_shengyu_num=Math.abs(orderItem.thisNum-count_num) ;//取绝对值

      }
      if(i==local_planDateList.length-1){
        // console.log("--有没有剩余:",orderItem.thisNum,"----i:",i)
        p_item[`${arr_name}_shengyu_num`]=orderItem.thisNum;
      }else{
        //下一个是周日，又没排班的话， 要提示
        let next_p_item=local_planDateList[i+1]
        if(!next_p_item.iz_xiu_xi){//next_p_item.sunday&&!next_p_item.sun_do

         // p_item[`${arr_name}_shengyu_num`]=orderItem.thisNum;//暂不提示

        }
      }
      p_item[`${arr_name}`]=child_arr;
       // console.log("--p_item:",p_item);

      /**
       * 初始化计算 --end
       */
    }

    if(rowIndex!=0){
      index_2_set.value=true;
      // rowIndex=0;
    }

    //去除选择项
    if(p_item.no_select_jiaban){
     // let child_arr=p_item[`${arr_name}`]||[];

    }

  }
  /**
   * 计算结束
   */
  /**
   * 统计 尾部合计
   */
  for(let i=p_index;i<local_planDateList.length;i++) {
    let p_item = local_planDateList[i];
    // let left_arr=p_item.left_arr;
    let arr1=p_item.arr1;
    let arr1_total=0,arr2_total=0;
    arr1.forEach((item,index)=>{
      if(item.num){
        arr1_total+=parseFloat(item.num);
        if(item.num2){
          arr1_total+=parseFloat(item.num2);
        }
      }
    })
    let arr2=p_item.arr2;
    arr2.forEach((item,index)=>{
      if(item.num){
        arr2_total+=parseFloat(item.num);
      }
      if(item.num2){
        arr1_total+=parseFloat(item.num2);
      }
    })
    p_item.footData.arr1_total=arr1_total.toFixed(0);
    p_item.footData.arr2_total=arr2_total.toFixed(0);
  }

  planDateList.value=local_planDateList

  index_2_set.value=false;
}



/**
 * 切线
 * @param orderItem
 * data 上行数据data
 */
function qixianSuccessFn2(orderItem){
  const {
    data,
    p_index,
    rowIndex,
    arr_name
  }= qie_xian_obj.value;

  /**
   * 校验型号
   */
  let modelJson =getCountModelJson();
  let pass=false;
  for (let key in modelJson) {
    //匹配型号 获取对应的产能
    if (orderItem.model.includes(key)) {
      pass=true;
    }
  }
  if(!pass){
    openAlert();
    return false;
  }
  // console.log("---data:",data,"----orderItem:",orderItem);

  qieXianTableFn(orderItem,data,p_index,rowIndex,arr_name);

  //数据备份
  backupFn();

}

function getCountModelJson(){
  let json={
    "100":"100",
    "200":"200_500",
    "500":"200_500",
    "计步器":"step",
    "K950":"K950"
  }
  return json;
}



function getActions(record,p_index,rowIndex,arr_name) {
  let arr=[];
  // console.log(`--mainId.value:${!!mainId.value}`)
  if(record.qieXian==1){
    arr.push({
      label: '切线',
      disabled:record.qieXian==1&&record.qieXianOver||!!mainId.value,
      onClick: handleEdit.bind(null, record,p_index,rowIndex,arr_name),
    })
  }else {
    arr.push({
      label: '标记',
      color: 'success',
      disabled:!!mainId.value,
      onClick: biaojiFn.bind(null, record,p_index,rowIndex,arr_name),
    })
  }
  return arr;
}

/**
 * 判断如果不是整数就进行四舍五入
 * @param num
 */
function formatNumber(num) {
  num=parseFloat(num);
  // 判断是否为整数（利用取余运算）
  if (num % 1 !== 0) {
    // 向下取整 不保留小数
    return Math.floor(num);
  } else {
    // 整数直接返回（可根据需求转为数字或字符串）
    return num;
  }
}

function handleEdit(record: Recordable,p_index,rowIndex,arr_name) {
  qie_xian_obj.value={
    data:record,
    p_index,
    rowIndex,
    arr_name
  }
  //record.qieXianOver=true;
  qieXianOrderRef.value.openFn({selectOrderNo:selectOrderNo.value});
}


/**
 * 标记
 */
function biaojiFn(record: Recordable,p_index,rowIndex,arr_name){
  biaoji_obj.value={
    data:record,
    p_index,
    rowIndex,
    arr_name
  };
  applyViewShow2.value=true;
}


function submitEvent2() {
  // console.log("--formData2:",formData2.value);
  if(!formData2.value.tagText){
    createMessage.error("请选择标记字母")
    return;
  }
  const {
    data,
    p_index,
    rowIndex,
    arr_name
  }= biaoji_obj.value;
  // console.log("-submitEvent2-data:",data);
  let local_planDateList= util.copy(planDateList.value);
  for(let i=0;i<local_planDateList.length;i++) {
    let p_item = local_planDateList[i];
    if (!p_item.iz_xiu_xi) {//p_item.sun_do || !p_item.sunday
      let child_arr = p_item[`${arr_name}`] || [];
      for (let i2 = 0; i2 < child_arr.length; i2++) {
        let item=child_arr[i2];
        if(data?.biaoShiHao==item.biaoShiHao){
          item.tagText=formData2.value.tagText;
        }
        if(data?.biaoShiHao==item.biaoShiHao2){
          item.tagText2=formData2.value.tagText;
        }
      }
    }
  }
  planDateList.value=local_planDateList;
  applyViewShow2.value=false;
}

function resetEvent2(){
  formData2.value={};
}

const openAlert = () => {
  VxeUI.modal.confirm({
    id:"myAlert1",
    content: '该产品型号不在目标产能表格中无法进行计算!',
    status: 'error',
    lockView: true,
    mask: false,
    showClose: false,
    showConfirmButton: false
  }).then(type => {
    console.log(`操作类型 ${type}`)
  })
}

const closeAlert = () => {
  VxeUI.modal.close("myAlert1")
}

/**
 * 提交
 */

function  subFn(){
  if(planDateList.value.length==0){
    createMessage.error("请先生成！")
    return;
  }
  let data={
    formData:formData.value,
    planDateList:planDateList.value,
    selectOrderNo:selectOrderNo.value,
  }
  // console.log("---data:",data);
  saveLoading.value=true;
  productionPlanAdd(data).then(res=>{
    if(res.code==200){
      mainId.value=res.data;
      // emit("success")
    }else{
      createMessage.error(res.message)
    }
  }).finally(()=>{
    saveLoading.value=false;
  });

}


/**
 * 数据备份
 */
function backupFn(){
  let obj={
    selectOrderNo:util.copy(selectOrderNo.value),
    planDateList:util.copy(planDateList.value),
  }
  operator_arr.value.push(obj);
}


/**
 * 撤回
 */
function recallFn(){
  let arr=operator_arr.value;

  if(arr.length>0){
    arr.pop();

    // if(arr.length==1){
    //
    // }else{
    //
    // }
    if(arr.length>0) {
      let obj = arr[arr.length - 1];
      selectOrderNo.value = obj.selectOrderNo;
      planDateList.value = obj.planDateList;
    }else{
      selectOrderNo.value =[];
      planDateList.value =[];
      dis_click_jiaban.value=false;
    }
    operator_arr.value=arr;
  }
}

/**
 * 查询日期记录
 */
function getDateRangeItemsFn(dates){
  loading.value=true;
  getDateRangeItems(formData.value.date_rang).then(res=>{
    if(res.code==200){
      planItems.value=res.data||[];
      createFn(dates);
    }else{
      createMessage.error(res.message)
    }
  });
}


function backFn(){
  // router.push({ path: `/productionPlanIndex`})
  router.back();
}

/**
 * get style
 */
function getGroupStyle(item){
  let style={};
  if(item.iz_jia_ban){
    style={height:(398+78)+"px"};
  }
  return style;
}

</script>
<style lang="less">
.my-table{
  //width: 40%;
  z-index: 9;
  width: 500px;
  margin-bottom: 5px;
  margin-top: 5px;
}
.line-table{
  //width: 37%;
  width: 50%;
}
.f-8 {
  line-height: 25px;
}
.table_top{
  margin-left: 10px;
  display: flex;
  //line-height: 45px;
  font-size: 12px;
}
.table_group{
  top: 5px;
  height:398px;
  display: flex;
  width: 100%;
  overflow-y: auto;
}
.vxe-cell{
  min-height: 26px !important;
  height: 26px !important;
  line-height: 12px;
}
.my_form{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  z-index: 99999;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
</style>
